package dto

import "time"

type FindLinkDTO struct {
	PageReq

	Gid       int64  `form:"gid,string" binding:"required"`
	OriginUrl string `form:"originUrl"`
}

type LinkDTO struct {
	Id            int64     `json:"id,string"`
	ShortId       string    `json:"shortId"`
	ShortUrl      string    `json:"shortUrl"`
	OriginUrl     string    `json:"originUrl"`
	ClickNum      int       `json:"clickNum"`
	Gid           int64     `json:"gid,string"`
	Favicon       string    `json:"favicon"`
	EnableStatus  int8      `json:"enableStatus"`
	ValidDateType int8      `json:"validDateType"`
	ValidDate     time.Time `json:"validDate"`
	Info          string    `json:"info"`
	CreateTime    time.Time `json:"createTime"`
	UpdateTime    time.Time `json:"updateTime"`
	DelTime       time.Time `json:"delTime"`
	DelState      int8      `json:"delState"`
}

type CreateLinkReq struct {
	OriginUrl     string `json:"originUrl" binding:"required"`
	Gid           int64  `json:"gid,string" binding:"required"`
	EnableStatus  int8   `json:"enableStatus" binding:"required"`
	ValidDateType int8   `json:"validDateType" binding:"required"`
	ValidDate     string `json:"validDate"`
	Info          string `json:"info"`
}

type UpdateStatusLinkReq struct {
	Id  int64 `json:"id,string" binding:"required"`
	Gid int64 `json:"gid,string" binding:"required"`
}

type DelLinkReq struct {
	Id  int64 `form:"id,string" binding:"required"`
	Gid int64 `form:"gid,string" binding:"required"`
}

type RedirectReq struct {
	ShortId string `uri:"shortId" binding:"required"`
}

type VisitRecordReq struct {
	PageReq

	ShortId   string `form:"shortId" binding:"required"`
	StartTime string `form:"startTime" binding:"required"`
	EndTime   string `form:"endTime" binding:"required"`
}

type VisitRecordDTO struct {
	Id            int64     `json:"id"`            // id
	ShortId       string    `json:"shortId"`       //ShortId 短链标识
	VisitTime     time.Time `json:"visitTime"`     //VisitTime 精确到毫秒的时间
	ClientIp      string    `json:"clientIp"`      //ClientIp IP地址
	CountryCode   string    `json:"countryCode"`   //CountryCode 国家代码
	Region        string    `json:"region"`        //Region 地区
	DeviceType    string    `json:"deviceType"`    //DeviceType 设备类型
	Os            string    `json:"os"`            //Os 操作系统
	Browser       string    `json:"browser"`       //Browser 浏览器
	Network       string    `json:"network"`       //Network
	RefererDomain string    `json:"refererDomain"` //RefererDomain 来源域名
	IsNew         int8      `json:"isNew"`         //IsNew 是否新访客 1 否 2 是
}
